using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._KML
{
    /// <summary>
    /// <para>KML To Layer</para>
    /// <para>Converts a KML or KMZ file into feature classes  and a layer file.  The layer file  maintains the symbology found within the original KML or KMZ file.</para>
    /// <para>将 KML 或 KMZ 文件转换为要素类和图层文件。 图层文件将保留在原始 KML 或 KMZ 文件中找到的符号系统。</para>
    /// </summary>    
    [DisplayName("KML To Layer")]
    public class KMLToLayer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public KMLToLayer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_kml_file">
        /// <para>Input KML File</para>
        /// <para>The KML or KMZ file to translate.</para>
        /// <para>要翻译的 KML 或 KMZ 文件。</para>
        /// </param>
        /// <param name="_output_folder">
        /// <para>Output Location</para>
        /// <para>The destination folder for the file geodatabase and layer (.lyrx) file.</para>
        /// <para>文件地理数据库和图层 （.lyrx） 文件的目标文件夹。</para>
        /// </param>
        public KMLToLayer(object _in_kml_file, object _output_folder)
        {
            this._in_kml_file = _in_kml_file;
            this._output_folder = _output_folder;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "KML To Layer";

        public override string CallName => "conversion.KMLToLayer";

        public override List<string> AcceptEnvironments => ["scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_kml_file, _output_folder, _output_data, _include_groundoverlay.GetGPValue(), _output_layer, _out_geodatabase];

        /// <summary>
        /// <para>Input KML File</para>
        /// <para>The KML or KMZ file to translate.</para>
        /// <para>要翻译的 KML 或 KMZ 文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input KML File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_kml_file { get; set; }


        /// <summary>
        /// <para>Output Location</para>
        /// <para>The destination folder for the file geodatabase and layer (.lyrx) file.</para>
        /// <para>文件地理数据库和图层 （.lyrx） 文件的目标文件夹。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Location")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_folder { get; set; }


        /// <summary>
        /// <para>Output Data Name</para>
        /// <para>The name of the output file geodatabase and layer file. The default is the name of the input KML file.</para>
        /// <para>输出文件地理数据库和图层文件的名称。默认值为输入 KML 文件的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Data Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_data { get; set; } = null;


        /// <summary>
        /// <para>Include Ground Overlay</para>
        /// <para><xdoc>
        ///   <para>Include ground overlays from the KML (raster, air photos, and so on). Use caution if the KMZ points to a service that serves raster imagery. The tool will attempt to translate the raster imagery at all available scales. This process could be lengthy and possibly overwhelm the service.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Ground overlay is included in the output.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Ground overlay is not included in the output. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包括 KML 中的地面叠加（栅格、航空照片等）。如果 KMZ 指向提供栅格影像的服务，请小心。该工具将尝试在所有可用比例下平移栅格影像。此过程可能很长，并且可能会使服务不堪重负。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 接地叠加包含在输出中。</bullet_item><para/>
        ///     <bullet_item>未选中 - 接地叠加不包含在输出中。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include Ground Overlay")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _include_groundoverlay_value _include_groundoverlay { get; set; } = _include_groundoverlay_value._false;

        public enum _include_groundoverlay_value
        {
            /// <summary>
            /// <para>GROUNDOVERLAY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("GROUNDOVERLAY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_GROUNDOVERLAY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_GROUNDOVERLAY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Layer File</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layer File")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output_layer { get; set; }


        /// <summary>
        /// <para>Output File Geodatabase</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output File Geodatabase")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_geodatabase { get; set; }


        public KMLToLayer SetEnv(object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}